<?php
/* @var $this ProductController */
/* @var $model Product */
/* @var $form CActiveForm */
?>

<script>

$(document).ready(function() {
	$('#Product_description').wymeditor({
		html : $("#Product_description").val()
	});
	
	$("form").submit(function(){
		$("#Product_description").val($.wymeditors(0).xhtml());
		
		return true;
	});
});
</script>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'product-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'fullName'); ?>
		<?php echo $form->textField($model,'fullName',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'fullName'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'cateId'); ?>
		<?php echo $form->dropDownList($model,'cateId', $model->getCateOptions()); ?>
		<?php echo $form->error($model,'cateId'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model,'description',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'imageUrl'); ?>
		<?php echo $form->textField($model,'imageUrl',array('size'=>60,'maxlength'=>300)); ?>
		<?php echo $form->error($model,'imageUrl'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'slideshow'); ?>
		<div>Các đường links cách nhau dấu phẩy ","</div>
		<?php echo $form->textArea($model,'slideshow',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'slideshow'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->